<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <%@ include file="/WEB-INF/pages/include/globa.jsp"%>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport"
        content="width=device-width, initial-scale=1">

	<title>花 · 生值</title>
	<link rel="stylesheet" href="${SERVER_PATH}/resources/css/common.css" />
	<link rel="stylesheet" href="${SERVER_PATH}/resources/js/amazeui/css/amazeui.min.css">
	<link rel="stylesheet" href="${SERVER_PATH}/resources/js/amazeui/css/admin.css">
	<link rel="stylesheet" href="${SERVER_PATH}/resources/js/amazeui/datatable/amazeui.datatables.min.css">
</head>
<body>

<header class="am-topbar am-topbar-inverse admin-header">
  <div class="am-topbar-brand">
    <strong>花生</strong> <small>后台管理</small>
  </div>
  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
</header>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
    <div class="am-offcanvas-bar admin-offcanvas-bar">
      <ul class="am-list admin-sidebar-list">
        <li><a href="${SERVER_PATH}/admin/page/user"><span class="am-icon-user"></span>用户</a></li>
        <li class="active"><a href="${SERVER_PATH}/admin/page/fee"><span class="am-icon-pencil-square-o"></span>花生值</a></li>
      </ul>
    </div>
  </div>
  <!-- sidebar end -->
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">花生值表</strong> / <small>Fee</small></div>
      </div>

      <hr>

      <div class="am-g">
        <div class="am-u-sm-12">
          <form class="am-form">
            <table 
			  width="100%"
			  class="am-table am-table-striped am-table-bordered am-table-compact am-text-nowrap"id="currentPageDataTable">
            	<thead>
	            <tr>
	                <th>id</th>
	                <th>套餐类型</th>
	                <th>待产周期</th>
	                <th>月子周期</th>
	                <th>增值服务</th>
	                <th>手机号</th>
	                <th>提交时间</th>
	                <th>访问域名</th>
	                <th>处理状态</th>
	            </tr>
	        </thead>
            </table>
          </form>
        </div>

      </div>
    </div>

    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2017 花·生</p>
    </footer>

  </div>
  <!-- content end -->
</div>

<script type="text/javascript" src="${SERVER_PATH}/resources/js/amazeui/js/amazeui.min.js"></script>
<script type="text/javascript" src="${SERVER_PATH}/resources/js/amazeui/datatable/amazeui.datatables.min.js"></script>
<script type="text/javascript" src="${SERVER_PATH}/resources/js/amazeui/js/default.js"></script>
<script>

var $currentPageDataTables;
var $currentPageDataSelector = "#currentPageDataTable";
var tableTitle = "花生值信息";
var dataTablesDataUrl = SERVER_PATH+"/fee/v1/list"; //数据url
var $toObjectDetailUrl = SERVER_PATH+'/admin/link/toLinkDetail';//
var $saveObjectDetailUrl = SERVER_PATH + '/admin/link/linkSave';
var $deleteObjectUrl = SERVER_PATH + '/admin/link/linkDelete';
var $objectDetailDialog;

$(document).ready(function() {
    var colsBindData = [
        {"data" : "fid"},
        {"data" : "type", render:function(data,type,row,meta){
        		var type = data==1?"高端定制":data==2?"独家定制":"温馨定制";
       	 	return type;
        }},
        {"data" : "deliveryCycle", render:function(data,type,row,meta){
        		var str = data==1?"1个月":data==2?"2个月":"3个月";
       	 	return str;
        }},
        {"data" : "confinementCycle", render:function(data,type,row,meta){
       		var str = data==1?"1个月":data==2?"2个月":"3个月";
       	 	return str;
        }},
        {"data" : "valueAdd", render:function(data,type,row,meta){
        		var str = "";
        		console.log(data);
        		switch (Number(data)) {
				case 1:
					str = "一对一月嫂服务";
					break;
				case 2:
					str = "一对一保姆照顾";
					break;
				case 3:
					str = "行前咨询包";
					break;
				case 4:
					str = "第三方专业签证";
					break;
				case 5:
					str = "其他";
					break;
				}
        		console.log(str);
       	 	return str;
        }},
        {"data" : "phone"},
        {"data" : "createTime"},
        {"data" : "host"},
        {"data" : "status", render:function(data,type,row,meta){
        	var img = data==1?"已反馈":"待反馈";
        	return img;
        }},
    ];
	var colsDefs = [
       {targets:0,visible:false},//第1列隐藏
    ];
	var appendReqParms = {};
	$currentPageDataTables = createCurrentPageDefaultDataTables($currentPageDataSelector,tableTitle,dataTablesDataUrl,appendReqParms,colsBindData,colsDefs);
	
} );
function searchForm(formid) {
	var queryString = $('#'+formid).formSerialize();
	var newurl = dataTablesDataUrl + '?'+queryString;
	$currentPageDataTables.ajax.url(newurl).load();
}
</script>
</body>
</html>